home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 October: Mac OS SDK / Dev.CD Oct 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / CIncludes / AIFF.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-12  |  6.0 KB  |  260 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        AIFF.h
  3.  
  4.      Contains:    Definition of AIFF file format components.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    © 1989-1997, 1997 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __AIFF__
  19. #define __AIFF__
  20.  
  21. #ifndef __TYPES__
  22. #include <Types.h>
  23. #endif
  24.  
  25.  
  26.  
  27. #if PRAGMA_ONCE
  28. #pragma once
  29. #endif
  30.  
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34.  
  35. #if PRAGMA_IMPORT
  36. #pragma import on
  37. #endif
  38.  
  39. #if PRAGMA_STRUCT_ALIGN
  40.     #pragma options align=mac68k
  41. #elif PRAGMA_STRUCT_PACKPUSH
  42.     #pragma pack(push, 2)
  43. #elif PRAGMA_STRUCT_PACK
  44.     #pragma pack(2)
  45. #endif
  46.  
  47.  
  48. enum {
  49.     AIFFID                        = FOUR_CHAR_CODE('AIFF'),
  50.     AIFCID                        = FOUR_CHAR_CODE('AIFC'),
  51.     FormatVersionID                = FOUR_CHAR_CODE('FVER'),
  52.     CommonID                    = FOUR_CHAR_CODE('COMM'),
  53.     FORMID                        = FOUR_CHAR_CODE('FORM'),
  54.     SoundDataID                    = FOUR_CHAR_CODE('SSND'),
  55.     MarkerID                    = FOUR_CHAR_CODE('MARK'),
  56.     InstrumentID                = FOUR_CHAR_CODE('INST'),
  57.     MIDIDataID                    = FOUR_CHAR_CODE('MIDI'),
  58.     AudioRecordingID            = FOUR_CHAR_CODE('AESD'),
  59.     ApplicationSpecificID        = FOUR_CHAR_CODE('APPL'),
  60.     CommentID                    = FOUR_CHAR_CODE('COMT'),
  61.     NameID                        = FOUR_CHAR_CODE('NAME'),
  62.     AuthorID                    = FOUR_CHAR_CODE('AUTH'),
  63.     CopyrightID                    = FOUR_CHAR_CODE('(c) '),
  64.     AnnotationID                = FOUR_CHAR_CODE('ANNO')
  65. };
  66.  
  67.  
  68. enum {
  69.     NoLooping                    = 0,
  70.     ForwardLooping                = 1,
  71.     ForwardBackwardLooping        = 2,                            /* AIFF-C Versions */
  72.     AIFCVersion1                = (long)0xA2805140
  73. };
  74.  
  75.  
  76.  
  77. /* Compression Names */
  78. #define NoneName "\pnot compressed"
  79. #define ACE2to1Name "\pACE 2-to-1"
  80. #define ACE8to3Name "\pACE 8-to-3"
  81. #define MACE3to1Name "\pMACE 3-to-1"
  82. #define MACE6to1Name "\pMACE 6-to-1"
  83.  
  84.  
  85. enum {
  86.                                                                 /* Compression Types */
  87.     NoneType                    = FOUR_CHAR_CODE('NONE'),
  88.     ACE2Type                    = FOUR_CHAR_CODE('ACE2'),
  89.     ACE8Type                    = FOUR_CHAR_CODE('ACE8'),
  90.     MACE3Type                    = FOUR_CHAR_CODE('MAC3'),
  91.     MACE6Type                    = FOUR_CHAR_CODE('MAC6')
  92. };
  93.  
  94. typedef unsigned long                     ID;
  95. typedef short                             MarkerIdType;
  96. struct ChunkHeader {
  97.     ID                                 ckID;
  98.     long                             ckSize;
  99. };
  100. typedef struct ChunkHeader ChunkHeader;
  101.  
  102. struct ContainerChunk {
  103.     ID                                 ckID;
  104.     long                             ckSize;
  105.     ID                                 formType;
  106. };
  107. typedef struct ContainerChunk ContainerChunk;
  108.  
  109. struct FormatVersionChunk {
  110.     ID                                 ckID;
  111.     long                             ckSize;
  112.     unsigned long                     timestamp;
  113. };
  114. typedef struct FormatVersionChunk FormatVersionChunk;
  115.  
  116. typedef FormatVersionChunk *            FormatVersionChunkPtr;
  117. struct CommonChunk {
  118.     ID                                 ckID;
  119.     long                             ckSize;
  120.     short                             numChannels;
  121.     unsigned long                     numSampleFrames;
  122.     short                             sampleSize;
  123.     extended80                         sampleRate;
  124. };
  125. typedef struct CommonChunk CommonChunk;
  126.  
  127. typedef CommonChunk *                    CommonChunkPtr;
  128. struct ExtCommonChunk {
  129.     ID                                 ckID;
  130.     long                             ckSize;
  131.     short                             numChannels;
  132.     unsigned long                     numSampleFrames;
  133.     short                             sampleSize;
  134.     extended80                         sampleRate;
  135.     ID                                 compressionType;
  136.     char                             compressionName[1];            /* variable length array, Pascal string */
  137. };
  138. typedef struct ExtCommonChunk ExtCommonChunk;
  139.  
  140. typedef ExtCommonChunk *                ExtCommonChunkPtr;
  141. struct SoundDataChunk {
  142.     ID                                 ckID;
  143.     long                             ckSize;
  144.     unsigned long                     offset;
  145.     unsigned long                     blockSize;
  146. };
  147. typedef struct SoundDataChunk SoundDataChunk;
  148.  
  149. typedef SoundDataChunk *                SoundDataChunkPtr;
  150. struct Marker {
  151.     MarkerIdType                     id;
  152.     unsigned long                     position;
  153.     Str255                             markerName;
  154. };
  155. typedef struct Marker Marker;
  156.  
  157. struct MarkerChunk {
  158.     ID                                 ckID;
  159.     long                             ckSize;
  160.     unsigned short                     numMarkers;
  161.     Marker                             Markers[1];                    /* variable length array */
  162. };
  163. typedef struct MarkerChunk MarkerChunk;
  164.  
  165. typedef MarkerChunk *                    MarkerChunkPtr;
  166. struct AIFFLoop {
  167.     short                             playMode;
  168.     MarkerIdType                     beginLoop;
  169.     MarkerIdType                     endLoop;
  170. };
  171. typedef struct AIFFLoop AIFFLoop;
  172.  
  173. struct InstrumentChunk {
  174.     ID                                 ckID;
  175.     long                             ckSize;
  176.     UInt8                             baseFrequency;
  177.     UInt8                             detune;
  178.     UInt8                             lowFrequency;
  179.     UInt8                             highFrequency;
  180.     UInt8                             lowVelocity;
  181.     UInt8                             highVelocity;
  182.     short                             gain;
  183.     AIFFLoop                         sustainLoop;
  184.     AIFFLoop                         releaseLoop;
  185. };
  186. typedef struct InstrumentChunk InstrumentChunk;
  187.  
  188. typedef InstrumentChunk *                InstrumentChunkPtr;
  189. struct MIDIDataChunk {
  190.     ID                                 ckID;
  191.     long                             ckSize;
  192.     UInt8                             MIDIdata[1];                /* variable length array */
  193. };
  194. typedef struct MIDIDataChunk MIDIDataChunk;
  195.  
  196. typedef MIDIDataChunk *                    MIDIDataChunkPtr;
  197. struct AudioRecordingChunk {
  198.     ID                                 ckID;
  199.     long                             ckSize;
  200.     UInt8                             AESChannelStatus[24];
  201. };
  202. typedef struct AudioRecordingChunk AudioRecordingChunk;
  203.  
  204. typedef AudioRecordingChunk *            AudioRecordingChunkPtr;
  205. struct ApplicationSpecificChunk {
  206.     ID                                 ckID;
  207.     long                             ckSize;
  208.     OSType                             applicationSignature;
  209.     UInt8                             data[1];                    /* variable length array */
  210. };
  211. typedef struct ApplicationSpecificChunk ApplicationSpecificChunk;
  212.  
  213. typedef ApplicationSpecificChunk *        ApplicationSpecificChunkPtr;
  214. struct Comment {
  215.     unsigned long                     timeStamp;
  216.     MarkerIdType                     marker;
  217.     unsigned short                     count;
  218.     char                             text[1];                    /* variable length array, Pascal string */
  219. };
  220. typedef struct Comment Comment;
  221.  
  222. struct CommentsChunk {
  223.     ID                                 ckID;
  224.     long                             ckSize;
  225.     unsigned short                     numComments;
  226.     Comment                         comments[1];                /* variable length array */
  227. };
  228. typedef struct CommentsChunk CommentsChunk;
  229.  
  230. typedef CommentsChunk *                    CommentsChunkPtr;
  231. struct TextChunk {
  232.     ID                                 ckID;
  233.     long                             ckSize;
  234.     char                             text[1];                    /* variable length array, Pascal string */
  235. };
  236. typedef struct TextChunk TextChunk;
  237.  
  238. typedef TextChunk *                        TextChunkPtr;
  239.  
  240. #if PRAGMA_STRUCT_ALIGN
  241.     #pragma options align=reset
  242. #elif PRAGMA_STRUCT_PACKPUSH
  243.     #pragma pack(pop)
  244. #elif PRAGMA_STRUCT_PACK
  245.     #pragma pack()
  246. #endif
  247.  
  248. #ifdef PRAGMA_IMPORT_OFF
  249. #pragma import off
  250. #elif PRAGMA_IMPORT
  251. #pragma import reset
  252. #endif
  253.  
  254. #ifdef __cplusplus
  255. }
  256. #endif
  257.  
  258. #endif /* __AIFF__ */
  259.  
  260.